Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce class hierarchy to support common Contest behaviors #125

Merged
merged 6 commits into from
Nov 15, 2022

Conversation

w7sst
Copy link
Owner

@w7sst w7sst commented Nov 13, 2022

Implements a common class hierarchy to support contests. contest-specific behaviors will be implemented in the various derived contests. See Issue #124 for a UML Class Diagram showing this hierarchy. This refactoring introduces the base TContest class along with 5 derived subclasses.

@w7sst w7sst self-assigned this Nov 13, 2022
Copy link
Collaborator

@jr8ppg jr8ppg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetCall and PickStation methods in TContest class should be abstract

@w7sst
Copy link
Owner Author

w7sst commented Nov 13, 2022

GetCall and PickStation methods in TContest class should be abstract

thank you! I was wanting to do that, but could not find the keyword.

@tekenny
Copy link
Collaborator

tekenny commented Nov 15, 2022

The code looks good to me but I'm still a newbie here :-)

Conceptually the abstraction seems good.
A couple of questions/suggestions:
1 - Rather than have a Pascal file for each contest could we have a config file for each contest to make it more data driven?
2 - I wonder if there is any way we can reuse N1MM Logger contest config files. If so that could make supporting contests allot easier.
Finally, I think this PR can be merged and the above 2 thoughts might just be considered for future enhancements assuming they are applicable and possible.

@w7sst
Copy link
Owner Author

w7sst commented Nov 15, 2022

The code looks good to me but I'm still a newbie here :-)

Conceptually the abstraction seems good. A couple of questions/suggestions: 1 - Rather than have a Pascal file for each contest could we have a config file for each contest to make it more data driven? 2 - I wonder if there is any way we can reuse N1MM Logger contest config files. If so that could make supporting contests allot easier. Finally, I think this PR can be merged and the above 2 thoughts might just be considered for future enhancements assuming they are applicable and possible.

I agree with your suggestions. Initially, the contests where all table driven with lots of switch statements. This class hierarchy removes the switch/case statements, but we still have lots of classes, one for each contest. I agree that additional table-driven techniques could be used as we identify common behaviors across contests. The tricky part I'm focusing on now is dynamic exchange types where the exchange changes by contest. I missed this during my initial design and am reworking my approach now.

To your second idea, yes, N1MM does have the UDC (User-defined contests) - that would be cool to perhaps support those someday.

I've been working with Steve, N2IC, on N1MM integration - I'm hoping that this multi-contest version can work with N1MM so N1MM can be used to enter contest data with MR generating the sounds.

@w7sst w7sst merged commit d12954b into main Nov 15, 2022
@w7sst w7sst deleted the replace-contest-object branch November 15, 2022 17:26
@w7sst w7sst restored the replace-contest-object branch November 16, 2022 05:34
@w7sst
Copy link
Owner Author

w7sst commented Nov 16, 2022

I discovered another issue with the above code. The FD, Wpx, WW, CWOPTS, and NaQP contests only need to read their call history files one time. Only the future ARRL DX Contest will require reloading if the user's callsign changes (part of a future integration).

w7sst added a commit that referenced this pull request Nov 23, 2022
This refactor step is necessary to prepare for dual exchange contests,
including ARRL DX Contest (part of issue #62). Previous refactoring
steps are covered in PR #132 and PR #125.

Changes in this PR include:
- after user callsign edits, SetMyCall is called.
- SetMyCall calls Tst.OnSetMyCall which will extract any
contest-specific information (e.g. in ARRL DX Contest, US/CA stations
work only DX and DX works only US/CA stations).
- call history file is now loaded after the user starts the contest
using the RUN button. This simplified the reload logic in case the user
callsign had changed.
- move logic from each derived call history reader into the base class
TContest.OnContestPrepareToStart function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants